#data {
#for (i in 1:N) {
#	dem_var1[i]<-(1/dem_var[i])
#	dem_est[i]~dnorm(dem[i], dem_var1[i])
#	}
#}

model {
for (i in 1:N) {
	xbeta[i]<-a[id[i]]+dem[i]*b[1]+conflict[i]*b[2]+
		(dem[i]*dem[i])*b[3]+t[i]*b[4]
	
	logit(pr[i])<-xbeta[i]
	ecrt[i]~dbern(pr[i])
	}

for (i in 1:41) {
	a[i]~dnorm(mu.a[i], tau)
	mu.a[i]<-g[1]+common[i]*g[2]
	}

for (k in 1:4) {
	b[k]~dnorm(0,.1)
	}

for (j in 1:2) {
	g[j]~dnorm(0,.1)
	}

tau~dgamma(.1, 1)

}

